home *** CD-ROM | disk | FTP | other *** search
- ;AGA Mirror Demo
- ;---------------
- ;Demo of the mirroring effect.
- ;
- ;Use the joystick to move the mirror up and down. When this effect is
- ;combined with a decrease in palette values at the same line, you can
- ;create the illusion of water.
-
- opt o+
-
- INCLUDE "exec/exec_lib.i"
- INCLUDE "games/games_lib.i"
- INCLUDE "games/games.i"
-
- LOCAL = 0
-
- CALL MACRO
- jsr _LVO\1(a6)
- ENDM
-
- SECTION "MirrorDemo",CODE
-
- ;===========================================================================;
- ; INITIALISE DEMO
- ;===========================================================================;
-
- Start: MOVEM.L A0-A6/D1-D7,-(SP)
- move.l ($4).w,a6
- lea GMS_Name(pc),a1
- moveq #$00,d0
- CALL OpenLibrary
- move.l d0,GMS_Base
- beq Quit
-
- move.l GMS_Base(pc),a6
- CALL SetUserPri
-
- move.l GMS_Base(pc),a6 ;Initialise our screen.
- lea ScreenStruct(pc),a0
- CALL Add_Screen
- tst.l d0
- bne.s Error
-
- move.l SS_MemPtr1(a0),a1 ;Destination = SS_MemPtr1.
- lea PackedPicFile(pc),a0 ;File Name.
- CALL QuickLoad
- tst.l d0
- beq.s Error
-
- lea ScreenStruct(pc),a0 ;Unpack the data on top of itself.
- move.l SS_MemPtr1(a0),a1
- move.l a1,a0
- moveq #$00,d0
- CALL SmartUnpack
-
- lea ScreenStruct(pc),a0 ;Now show the screen/pic.
- CALL Show_Screen
-
- ;===========================================================================;
- ; MAIN CODE
- ;===========================================================================;
-
- Loop: CALL Wait_OSVBL
- CALL Update_RasterList
- moveq #JPORT2,d0
- moveq #JT_SWITCH,d1
- CALL Read_JoyPort
- .up btst #JS_UP,d0
- beq.s .down
- subq.w #1,RasterList+2
- .down btst #JS_DOWN,d0
- beq.s .fire
- addq.w #1,RasterList+2
- .fire btst #JS_FIRE1,d0
- beq.s Loop
-
- Fade: CALL Wait_OSVBL
- moveq #2,d0 ;d0 = Speed of fade.
- CALL B24_FadeToBlack ;Do the fade routine.
- tst.w d0 ;Has the fade finished yet?
- bne.s Fade ;If not, keep doing it.
-
- ;===========================================================================;
- ; RETURN TO DOS
- ;===========================================================================;
-
- CALL Delete_Screen ;Give back screen memory etc.
- Error move.l GMS_Base(pc),a1
- move.l ($4).w,a6
- CALL CloseLibrary
- Quit MOVEM.L (SP)+,A0-A6/D1-D7
- moveq #$00,d0
- rts
-
- ;===========================================================================;
- ; DATA
- ;===========================================================================;
-
- GMS_Name:
- dc.b "games.library",0
- even
- GMS_Base:
- dc.l 0
-
- AMT_PLANES = 7
-
- ScreenStruct:
- dc.l "GSV1"
- dc.l 0,0,0 ;Screen_Mem1/2/3
- dc.l 0 ;Screen link.
- dc.l ScreenPalette ;Address of screen palette.
- dc.l RasterList ;Address of rasterlist.
- dc.l 256 ;Amt of colours in palette.
- dc.w 256,320,320/8 ;Screen Height, Width, Width/8
- dc.w 256,320,320/8 ;Pic Height, Width, Width/8
- dc.w AMT_PLANES ;Amt_Planes
- dc.w 0,0 ;Top Of Screen, X/Y
- dc.w 0 ;Scroll buffer in pixels/8.
- dc.w 0,0 ;X/Y counters (for scrolling).
- dc.l NOBURST ;Special attributes.
- dc.w LORES|_24BITCOL ;Screen mode.
- dc.b INTERLEAVED ;Screen type
- dc.b 0 ;Screen Is Being Displayed?
- dc.l 0,0 ;Reserved area.
- even
-
- RasterList:
- WAITLINE 164
- MIRROR
- RASTEND
-
- ScreenPalette:
- dc.l $000000,$FFFFFF,$FAF5F2,$FAE8E7
- dc.l $EEDED5,$E8D4C8,$DDC0AF,$D7B5A2
- dc.l $D1AC96,$DCA491,$CBA38B,$C5997E
- dc.l $BD8E74,$B5846A,$AD7A5F,$A57056
- dc.l $9D674D,$955D44,$8C533B,$844B34
- dc.l $7C432D,$743B26,$6C3320,$642D1B
- dc.l $5C2616,$532010,$4A1D0C,$411A09
- dc.l $381606,$2F1204,$260F02,$1D0C00
- dc.l $AC783A,$A67139,$A06C39,$986638
- dc.l $995F36,$906037,$8C5C36,$945733
- dc.l $865735,$905030,$7E5133,$8D4B2E
- dc.l $764B31,$6E4630,$8A462D,$64412B
- dc.l $5D3D27,$593A24,$543822,$50351F
- dc.l $4B341D,$47301A,$592218,$402D17
- dc.l $382813,$3B2007,$302310,$2B200D
- dc.l $331100,$430907,$3C0504,$2E0202
- dc.l $B48038,$B7743D,$AE6350,$A85D4A
- dc.l $A35644,$9E503E,$994A39,$944534
- dc.l $9F4336,$8E3F30,$87412B,$87382A
- dc.l $823628,$803226,$792C21,$72251C
- dc.l $E1AB98,$DBA28C,$D79C89,$D29582
- dc.l $CD8D7A,$C88672,$C27E6B,$BD7764
- dc.l $B8705D,$B36A57,$BB5244,$AD4A3D
- dc.l $C8594A,$7F7444,$847D49,$67271E
- dc.l $6C2219,$651D15,$5E1711,$57130E
- dc.l $500F0B,$4A0C09,$350303,$270000
- dc.l $89874E,$8C8E53,$8C9358,$8E9D62
- dc.l $C6904A,$9AA467,$CD9E51,$AFAE6F
- dc.l $E3D765,$D5AE58,$BCAD78,$C1AC7C
- dc.l $CBAA82,$D5A588,$EAA09B,$ECA7A2
- dc.l $EDADA9,$EFB5B1,$F0BBB8,$F2C2BF
- dc.l $F4CBC8,$F5D1CF,$F7D9D7,$FDF7F7
-
- PackedPicFile:
- IFNE LOCAL
- dc.b "GAMESLIB:"
- ENDC
- dc.b "data/Yattering128.pak",0
- even
-
-